Optimal. Leaf size=22 \[ \sec (x)+\frac{1}{2} i \tanh ^{-1}(\sin (x))-\frac{1}{2} i \tan (x) \sec (x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.148243, antiderivative size = 22, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.538, Rules used = {3518, 3108, 3107, 2606, 8, 2611, 3770} \[ \sec (x)+\frac{1}{2} i \tanh ^{-1}(\sin (x))-\frac{1}{2} i \tan (x) \sec (x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3518
Rule 3108
Rule 3107
Rule 2606
Rule 8
Rule 2611
Rule 3770
Rubi steps
\begin{align*} \int \frac{\sec ^3(x)}{i+\cot (x)} \, dx &=-\int \frac{\sec ^2(x) \tan (x)}{-\cos (x)-i \sin (x)} \, dx\\ &=i \int \sec ^2(x) (-i \cos (x)-\sin (x)) \tan (x) \, dx\\ &=i \int \left (-i \sec (x) \tan (x)-\sec (x) \tan ^2(x)\right ) \, dx\\ &=-\left (i \int \sec (x) \tan ^2(x) \, dx\right )+\int \sec (x) \tan (x) \, dx\\ &=-\frac{1}{2} i \sec (x) \tan (x)+\frac{1}{2} i \int \sec (x) \, dx+\operatorname{Subst}(\int 1 \, dx,x,\sec (x))\\ &=\frac{1}{2} i \tanh ^{-1}(\sin (x))+\sec (x)-\frac{1}{2} i \sec (x) \tan (x)\\ \end{align*}
Mathematica [B] time = 0.143061, size = 48, normalized size = 2.18 \[ -\frac{1}{2} i \left ((\tan (x)+2 i) \sec (x)+\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )-\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.048, size = 84, normalized size = 3.8 \begin{align*}{{\frac{i}{2}} \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) ^{-2}}+{\frac{i}{2}}\ln \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) + \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}-{{\frac{i}{2}} \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}-{\frac{i}{2}}\ln \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) -{{\frac{i}{2}} \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) ^{-2}}- \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}-{{\frac{i}{2}} \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.31561, size = 127, normalized size = 5.77 \begin{align*} \frac{\frac{i \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac{2 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac{i \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - 2}{\frac{2 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac{\sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} - 1} + \frac{1}{2} i \, \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) - \frac{1}{2} i \, \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{{\left (2 \,{\left (e^{\left (4 i \, x\right )} + 2 \, e^{\left (2 i \, x\right )} + 1\right )} e^{\left (2 i \, x\right )}{\rm integral}\left (\frac{{\left (-11 i \, e^{\left (5 i \, x\right )} - 6 i \, e^{\left (3 i \, x\right )} - 3 i \, e^{\left (i \, x\right )}\right )} e^{\left (-2 i \, x\right )}}{2 \,{\left (e^{\left (6 i \, x\right )} + 3 \, e^{\left (4 i \, x\right )} + 3 \, e^{\left (2 i \, x\right )} + 1\right )}}, x\right ) - e^{\left (3 i \, x\right )} - 3 \, e^{\left (i \, x\right )}\right )} e^{\left (-2 i \, x\right )}}{2 \,{\left (e^{\left (4 i \, x\right )} + 2 \, e^{\left (2 i \, x\right )} + 1\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec ^{3}{\left (x \right )}}{\cot{\left (x \right )} + i}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.299, size = 77, normalized size = 3.5 \begin{align*} -\frac{i \, \tan \left (\frac{1}{2} \, x\right )^{3} + 2 \, \tan \left (\frac{1}{2} \, x\right )^{2} + i \, \tan \left (\frac{1}{2} \, x\right ) - 2}{{\left (\tan \left (\frac{1}{2} \, x\right )^{2} - 1\right )}^{2}} + \frac{1}{2} i \, \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) + 1 \right |}\right ) - \frac{1}{2} i \, \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]